package com.qingfeng.client.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qingfeng.client.bean.OrderGoods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhangyuefei
 * @version 1.0
 * @date 2020/1/6 10:16 上午
 */
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
    int insertList(@Param("list")List<OrderGoods> list);

    List<OrderGoods> selectByOrderStoreId(@Param("orderStoreId")Long orderStoreId,@Param("storeId")Integer storeId);

    List<OrderGoods> getByTradeIdAndStoreId(@Param("tradeId")Long tradeId,@Param("storeId")Integer storeId);

    int updateStatById(@Param("updatedStat")Integer updatedStat,@Param("id")Long id);

    int updatePriceAndTotalPriceById(@Param("updatedPrice")Integer updatedPrice,@Param("updatedTotalPrice")Integer updatedTotalPrice,@Param("id")Long id);

    /**
     * 修改商品状态，只有当原来状态不是售后状态是，才可以修改
     * @param updatedStat
     * @param orderStoreId
     * @return
     */
    int updateStatByOrderStoreId(@Param("updatedStat")Integer updatedStat,@Param("orderStoreId")Long orderStoreId);





}
